<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生表</title>
    <link rel="stylesheet" type="text/css" href="e1.css">
</head>
<body>

<form id="studentForm">
    <table>
        <tr><th>
    <label for="name" onclick="focusInput('name')">姓名:</label>
    <input type="text" id="name" required>
    </th></tr>

        <tr><th>
    <label for="sid" onclick="focusInput('sid')">学号:</label>
    <input type="text" id="sid" required></th></tr>
   

 
<tr><th>
    <label onclick="focusInput('gender')">性别:</label>
    <input type="radio" id="male" name="gender" value="男" required>
    <label for="male">男</label>
    <input type="radio" id="female" name="gender" value="女">
    <label for="female">女</label>
</th></tr>
    
<tr><th>
    <label for="class" onclick="focusInput('class')">班级:</label>
    <select id="class" required>
        <optgroup label="CS">
            <option value="CS1班">1班</option>
            <option value="CS2班">2班</option>
            <option value="CS3班">3班</option>
            <option value="CS4班">4班</option>
        </optgroup>
        <optgroup label="NE">
            <option value="NE1班">1班</option>
            <option value="NE2班">2班</option>
            <option value="NE3班">3班</option>
            <option value="NE4班">4班</option>
        </optgroup>
    </select>
</th></tr>  

<tr> <th> <label for="age" onclick="focusInput('age')">年龄:</label>
    <input type="number" id="age" required min="18" max="24"></th></tr>
   
</table>
</form>

<h2>学生表</h2>
<table id="studentTable" border="1">
    <thead>
    <tr>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>学号</th>
        <th>班级</th>
    </tr>
    </thead>
    <tbody ondragover="allowDrop(event)" ondrop="drop(event)"></tbody>
</table>

<div class="button-container">
    <button onclick="addStudent()">添加学生信息</button>
    <button onclick="deleteStudent()">删除学生信息</button>
    <button onclick="showStatistics()">统计学生信息</button>
</div>

<script src="e2.js"></script>

</body>
</html>
